<%@ page import="com.casework.OriginOfDivestment; com.casework.LegalCase; com.casework.YesNoNA; com.casework.RelativeToSO; com.casework.CompetitionConcern; com.casework.PurchaserCriteria" %>
<!doctype html>
<html>
<head>
    <title>compRxinsight - merger remedy analysis</title>
    <meta name="layout" content="main"/>

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <meta content="www.competitionRX.com" name="Author">

    <meta content="global" name="Distribution">
    <meta content="all" name="ROBOTS">
    <meta content="Safe for Kids" name="document-rating">
    <r:use modules="jsPlumb"/>

</head>

<body>
<div id="pageBody" class="<sec:ifAnyGranted roles="ROLE_ADMIN,ROLE_USER">logged-in</sec:ifAnyGranted>">
    <g:render template="/layouts/adminNav"/>



    <sec:ifNotLoggedIn>
        <div class="stats">
            <ul>
                <li>Active cases: ${cases}</li>
                <li>Active measures: ${measures}</li>
                <li>Active firms: ${firms}</li>
                <li>Active industries: ${naces}</li>
            </ul>
        </div>

        <div class="everyone-view">
            <div class="updated-cases">
            <h3>About RxInsight</h3>
            The RxInsight database is the result of a research project into the European Commission's conditional merger approval decisions since 2000.
            <br>
            <br>
            RxInsight allows users to search efficiently for past decision and access key information about past cases quickly and consistently and provides a powerful tool for the identification and analysis of cases with similar competition and industry characteristics. Only the European Commission has a comparable source of data that enables current and past cases to be analysed across multiple company, industry, competition and remedy specific factors.
            <br>
            RxInsight provides companies and advisors with the ability to match this knowledge and to design optimal remedies which both address the Commission’s competition concerns and are consistent with their commercial and transaction objectives.

            <h3 class="about-competitionrx">About CompetitionRx</h3>
CompetitionRx is a consultancy supporting firms around remedies and compliance. Our services include acting as monitoring and/or divestiture trustee in mergers, antitrust as well as state aid cases, assessing the impact of new regulations as well as antitrust infringements - including the assessment of private damages – and supporting firms in the development of antitrust compliance programs.
           <br>
           <br>
            Our team includes senior professionals with experience in competition economics, competition law, corporate finance, corporate governance and business management.
            </div>
        </div>
    </sec:ifNotLoggedIn>

    <sec:ifAnyGranted roles="ROLE_ADMIN, ROLE_USER">
        <div class="logged-in-view">
            <div class="updated-cases search-container">

                <g:form action="search" controller="search" class="search-form">

                    <div class="text-search">
                        <h3>Full Text Search</h3>
                        <ul class="ui-widget">
                            <li class="title">Text Search: </li>
                            <li><input id="textQuery" name="textQuery"/></li>
                        </ul>
                        <ul>
                                <li><g:radio value="${true}" name="cases" checked="checked"/>Case</li>
                                <li><g:radio value="${false}" name="cases"/>Measure</li>
                            </ul>
                        <tmpl:searchButtons searchButton='bottom-search-buttons'/>
                    </div>


                    <div class="nace">
                        <h3>Filter by Industry</h3>

                        <ul class="industry-container">
                            <li class="title">Industry Description <span class="multiSelect">(CTRL and CLICK for multi-select)</span></li>
                            <li><g:select id="shortNace" name="shortNace" from="${com.casework.Nace.getActiveNaceCategories()}"
                                           multiple="true"/></li>
                        </ul>
                        <ul class="ui-widget">
                            <li class="title">Notifying Parties: </li>
                            <li><input id="firmNames" name="firmNames"/></li>
                        </ul>


                    </div>


                    <div>
                        <h3 id="competition-concern-title" original-title="Twipsy test">Filter by Competition Concern </h3>
                        <ul class="search-inputs competition-concern">

                            <li class="cc-element"><g:checkBox name="competitionConcern"
                                                               value="${CompetitionConcern.Horizontal}"
                                                               checked="${false}"/>Horizontal</li>
                            <li class="cc-element"><g:checkBox name="competitionConcern"
                                                               value="${CompetitionConcern.Vertical}"
                                                               checked="${false}"/>Vertical</li>
                            <li class="cc-element"><g:checkBox name="competitionConcern"
                                                               value="${CompetitionConcern.Conglomerate}"
                                                               checked="${false}"/>Conglomerate</li>
                            <li class="cc-element"><g:checkBox name="competitionConcern"
                                                               value="${CompetitionConcern.Mixed}"
                                                               checked="${false}"/>Mixed</li>

                        </ul>
                    </div>

                    <div>
                        <h3>Filter on Cases</h3>

                        <ul class="search-inputs ecNumber">
                            <li class="title">EC Number</li>
                            <li><g:select id="ecNumberStr" name="ecNumberStr" from="${LegalCase.getEcNumbers()}"
                                          noSelection="['': '']"/></li>

                        </ul>

                        <ul class="search-inputs yearOfDecision">
                            <li class="title">Year of Decision</li>
                            <li class="decision-date"><g:select name='fromDecisionYear'
                                                                from="${LegalCase.getAllDecisionDates().sort()}"
                                                                noSelection="['': 'From']"/></li>
                            <li class="decision-date"><g:select name='toDecisionYear'
                                                                from="${LegalCase.getAllDecisionDates().sort()}"
                                                                noSelection="['': 'To']"/></li>
                        </ul>


                        <ul class="search-inputs phase">
                            <li class="title">Phase</li>
                            <li class="purchase-criteria"><g:checkBox id='phase1' name="phaseStr" value="${1}"
                                                                      checked="${false}"/>1</li>
                            <li class="purchase-criteria"><g:checkBox id='phase2' name="phaseStr" value="${2}"
                                                                      checked="${false}"/>2</li>
                        </ul>

                        <ul class="search-inputs relative-to-so">
                            <li class="title">Relative To SO</li>
                            <li class="purchase-criteria"><g:checkBox name="relativeToSOStr"
                                                                      value="${RelativeToSO.Pre}"
                                                                      checked="${false}"
                                                                      disabled="true"/>Pre</li>
                            <li class="purchase-criteria"><g:checkBox name="relativeToSOStr"
                                                                      value="${RelativeToSO.Post}"
                                                                      checked="${false}"
                                                                      disabled="true"/>Post</li>
                        </ul>
                    </div>

                    <div>
                        <h3>Filter on Measures</h3>

                        <ul class="search-inputs clusterOfSale">

                            <li class="title">Cluster Sale <casework:tooltip title="${g.message(code:'balloon.cluster.sale')}" /></li>
                            <li class="purchase-criteria"><g:checkBox name="clusterSaleStr"
                                                                      value="${YesNoNA.Yes}"
                                                                      checked="${false}"/>Yes</li>
                            <li class="purchase-criteria"><g:checkBox name="clusterSaleStr"
                                                                      value="${YesNoNA.No}"
                                                                      checked="${false}"/>No</li>
                        </ul>


                        <ul class="search-inputs alternative-remedy">

                            <li class="title">Alternative Remedy <casework:tooltip title="${g.message(code:'balloon.alternative.remedy')}" /></li>
                            <li class="purchase-criteria"><g:checkBox name="alternativeRemedyStr"
                                                                      value="${YesNoNA.Yes}"
                                                                      checked="${false}"/>Yes</li>
                            <li class="purchase-criteria"><g:checkBox name="alternativeRemedyStr"
                                                                      value="${YesNoNA.No}"
                                                                      checked="${false}"/>No</li>
                        </ul>

                        <ul class="search-inputs purchaseCriteria">

                            <li class="title">Purchaser Requirements</li>
                            <li class="purchase-criteria"><g:checkBox name="purchaserCriteriaStrs"
                                                                      value="${PurchaserCriteria.Fix_It_First}"
                                                                      checked="${false}"/>Fix it first <casework:tooltip title="${g.message(code:'balloon.fixit.first')}" /></li>
                            <li class="purchase-criteria"><g:checkBox name="purchaserCriteriaStrs"
                                                                      value="${PurchaserCriteria.Purchaser_Requirements}"
                                                                      checked="${false}"/>Additional purchaser criteria <casework:tooltip title="${g.message(code:'balloon.purchaser_requirements')}" /></li>
                            <li class="purchase-criteria"><g:checkBox name="purchaserCriteriaStrs"
                                                                      value="${PurchaserCriteria.Up_Front_Buyer}"
                                                                      checked="${false}"/>Up front buyer <casework:tooltip title="${g.message(code:'balloon.up.front.buyer')}" /></li>
                        </ul>

                        <ul class="search-inputs originOfDivestment">

                            <li class="title">Origin of divestment</li>
                            <li class="purchase-criteria"><g:checkBox name="originOfDivestmentStrs"
                                                                      value="${OriginOfDivestment.Bidder}"
                                                                      checked="${false}"/>Bidder</li>
                            <li class="purchase-criteria"><g:checkBox name="originOfDivestmentStrs"
                                                                      value="${OriginOfDivestment.Target}"
                                                                      checked="${false}"/>Target</li>
                            <li class="purchase-criteria"><g:checkBox name="originOfDivestmentStrs"
                                                                      value="${OriginOfDivestment.Mixed}"
                                                                      checked="${false}"/>Mixed</li>
                        </ul>


                        <tmpl:graph/>

                        <div>
                            <h3>Results by</h3>
                            <ul>
                                <li><g:radio value="${true}" name="cases" checked="checked"/>Case</li>
                                <li><g:radio value="${false}" name="cases"/>Measure</li>
                            </ul>
                        </div>

                        <tmpl:searchButtons searchButton='bottom-search-buttons'/>
                    </div>
                </g:form>
            </div>
        </div>

        <r:script>

            $('.tooltip-west').tipsy({gravity: 'nw'});

            $('.window').tipsy();
            $('.tooltip').tipsy();

            $('#phase1').click(function(){
                toggleRelativeSO();
            });
            $('#phase2').click(function(){
                toggleRelativeSO();
            })

            toggleRelativeSO();
            function toggleRelativeSO(){
                if($('#phase2').is(':checked')){
                    $('.relative-to-so input[type="checkbox"]').prop('disabled', false);
                }else {
                    $('.relative-to-so input[type="checkbox"]').prop('disabled', true);
                    $('.relative-to-so input[type="checkbox"]').each(function(index, el){
                        $(el).prop("checked", false);
                    })
                }
            }

        </r:script>
    </sec:ifAnyGranted>
</div>

</body>
</html>
